<?php
$nome_interessado = $_GET["cdUsuario_interessado"]; 
$email_interessado = "rv.thiagovieira@gmail.com";

$nome_dono = $_GET["cdUsuario_dono"];
$email_dono = "rv.thiagovieira@gmail.com";

require("../lib/phpmailer/class.phpmailer.php");
require("../lib/phpmailer/class.smtp.php");
//require("class.phpmailer.php");

		$mail = new PHPMailer(); 
		$mail->IsSMTP(); 
		$mail->Port = 465; 
		$mail->Host = 'smtp.gmail.com'; 
		$mail->IsHTML(true); 
		$mail->Mailer = 'smtp'; 
		$mail->SMTPSecure = 'ssl'; 
		//$mail->SMTPSecure = 'tls';
		$mail->SMTPAuth = true; 
		$mail->Username = "teste.cetil@gmail.com"; 
		$mail->Password = "casinha1"; 
		$mail->SingleTo = true;
		//$from = $this -> "rv.thiagovieira@gmail.com";
		//$fromname = $this -> "thiago";
		
		$mail->From = "nasket.inc@gmail.com"; // Seu e-mail
		$mail->FromName = "Handel"; // Seu nome
		
		$mail->IsHTML(true);
		$mail->CharSet = 'iso-8859-1';
				
		$body = "<!DOCTYPE html>";
		$body .= "<html>";
		$body .= "   <head>";
		$body .= "      <title>Handel</title>";
		$body .= "   </head>";
		$body .= "   <body>";
		$body .= "      <fieldset>";
		$body .= "         <img src='https://lh4.googleusercontent.com/-wdG0MRrR734/VX15141Za2I/AAAAAAAAAH0/RoXtBQgS6pU/w189-h48-no/imagem_email.png'></img>";
		$body .= "         </br>";
		$body .= "         </br>";
		$body .= "         <p>Caro(a) <i>".$nome_interessado."</i></p></br>";
		$body .= "         <div id='texto'></div>";
		$body .= "         </br>";
		$body .= "         <fieldset>";
		$body .= "            <div id 'teste'>";
		$body .= "               <p> Sua proposta para o usu&aacute;rio <i>".$nome_dono."</i> foi <b style='color:red'>rejeitada<b></p>";
		
		$body .= "               <p>Itens da sua proposta: </p>";
		
		//FOR com os itens
		$body .= "               <p>";
		$body .= "               <TABLE  border='1'>";
		$body .= "                  <TR>";
		$body .= "                     <TD width=100><b>Item:</b> </TD>";
		$body .= "                     <TD width=200>GTA V</TD>";
		$body .= "                  </TR>";
		$body .= "                  <TR>";
		$body .= "                     <TD width=100><b>Plataforma:</b> </TD>";
		$body .= "                     <TD>PS3</TD>";
		$body .= "                  </TR>";
		$body .= "               </TABLE>";
		$body .= "               </p>";
		
		$body .= "            </div>";
		$body .= "         </fieldset>";
		$body .= "      </fieldset>";
		$body .= "   </body>";
		$body .= "</html>";		
				
		$mail->addAddress($email_dono);
		$mail->Subject = "Bem-Vindo";
		$mail->Body = $body; //"MENSAGEM";
		$result = $mail->Send();
		if($result){
			echo 'Email enviado com Sucesso!';
		}
		else{
			echo 'Erro ao enviar email!  '. $mail->ErrorInfo;
		}
?>